package ee.az.tetris.worker;

import ee.az.tetris.Glass;
import ee.az.tetris.event.Event;

public class EmitterWorker extends Worker {
	
	public EmitterWorker(Glass glass) {
		super(glass);
	}
	
	@Override
	public void work(Event event) {
		int len = (int)(Math.random()*5)+1;
		for (int i=0; i<len; i++) {
			getGlass().setValueAt(Glass.FLOATING, 0, getGlass().getColumnCount()/2 - len/2 + i);
		}
		
	}
}
